package com.smartcommunity.job;

import com.smartcommunity.service.people.impl.PeopleServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 将vid引擎中的vid信息同步到业务实有人口库
 */
@Slf4j
@Component
public class VidSyncJob {

    @Autowired
    private PeopleServiceImpl peopleService;

    @Scheduled(initialDelay = 10 * 1000, fixedDelay = 20 * 60 * 1000)
    public void syncPeopleVid() {
        log.info("从vid同步置信信息到社区实有人口任务开始...");
        long st =System.currentTimeMillis();
        peopleService.syncPeopleVid();
        long speedTime=System.currentTimeMillis()-st;
        log.info("从vid同步置信信息到社区实有人口任务结束..，耗时：{}毫秒",speedTime);
    }
}
